﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WorldViewSolutions.ArcGISServer.SOE.DataSources;

namespace WorldViewSolutions.ArcGISServer.SOE
{
    /// <summary>
    /// 
    /// </summary>
    /// <remarks></remarks>
	public class ExportMapResource
	{
        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>The name.</value>
		public string Name { get; set; }

        /// <summary>
        /// Gets or sets the resource.
        /// </summary>
        /// <value>The resource.</value>
		public IMapDResource Resource { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether [display in table of contents].
        /// </summary>
        /// <value><c>true</c> if [display in table of contents]; otherwise, <c>false</c>.</value>
		public Boolean DisplayInTableOfContents { get; set; }

        /// <summary>
        /// Gets or sets the opacity.
        /// </summary>
        /// <value>The opacity.</value>
        public double Opacity { get; set; }

        /// <summary>
        /// Gets or sets the export image quality.
        /// </summary>
        /// <value>The export image quality.</value>
        public ExportImageQuality ExportImageQuality { get; set; }

        public List<DynamicLayer> DynamicLayers { get; set; }

        /// <summary>
        /// Gets the DPI.
        /// </summary>
        /// <remarks></remarks>
        public int DPI 
        { 
            get
            {
                switch(this.ExportImageQuality)
                {
                    case ExportImageQuality.Standard:
                        return 96;
                    case ExportImageQuality.Better:
                        return 150;
                    case ExportImageQuality.Best:
                        return 300;
                    default:
                        return 96;
                }
            }
        }


        /// <summary>
        /// Initializes a new instance of the <see cref="ExportMapResource"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="resource">The resource.</param>
        /// <param name="exportImageQuality">The export image quality.</param>
        /// <param name="opacity">The opacity.</param>
        /// <param name="displayInTableOfContents">if set to <c>true</c> [display in table of contents].</param>
        /// <remarks></remarks>
        public ExportMapResource(string name, IMapDResource resource, ExportImageQuality exportImageQuality, double opacity, bool displayInTableOfContents, List<DynamicLayer> dynamicLayers)
		{
            this.Name = name;
            this.Resource = resource;
            this.ExportImageQuality = exportImageQuality;
            this.Opacity = opacity;
            this.DisplayInTableOfContents = displayInTableOfContents;
            this.DynamicLayers = dynamicLayers;
		}
	}
}
